/*-------------------------------------------------------------------------
 *
 * pg_statistic_ext_data.h
 *	  "扩展统计数据" 系统目录 (pg_statistic_ext_data) 的定义
 *
 * 此目录存储扩展统计对象的统计数据。
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/catalog/pg_statistic_ext_data.h
 *
 * NOTES
 *	  Catalog.pm 模块读取此文件并推导模式信息。
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_STATISTIC_EXT_DATA_H
#define PG_STATISTIC_EXT_DATA_H

#include "catalog/genbki.h"
#include "catalog/pg_statistic_ext_data_d.h"

/* ----------------
 *		pg_statistic_ext_data 定义。 cpp 将其转换为
 *		typedef struct FormData_pg_statistic_ext_data
 * ----------------
 */
CATALOG(pg_statistic_ext_data,3429,StatisticExtDataRelationId)
{
	Oid			stxoid BKI_LOOKUP(pg_statistic_ext);	/* 该数据对应的统计对象
														 * */
	bool		stxdinherit;	/* 如果包含继承子类则为真 */

#ifdef CATALOG_VARLEN			/* 可变长度字段从这里开始 */

	pg_ndistinct stxdndistinct; /* ndistinct 系数（序列化） */
	pg_dependencies stxddependencies;	/* 依赖关系（序列化） */
	pg_mcv_list stxdmcv;		/* MCV (serialized) */
	pg_statistic stxdexpr[1];	/* 表达式的统计信息 */

#endif

} FormData_pg_statistic_ext_data;

/* ----------------
 *		Form_pg_statistic_ext_data 对应指向具有
 *		pg_statistic_ext_data 关系格式的元组的指针。
 * ----------------
 */
typedef FormData_pg_statistic_ext_data *Form_pg_statistic_ext_data;

DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431);

DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_data_stxoid_inh_index, 3433, StatisticExtDataStxoidInhIndexId, on pg_statistic_ext_data using btree(stxoid oid_ops, stxdinherit bool_ops));


#endif							/* PG_STATISTIC_EXT_DATA_H */
